    //MEP Divenav
	//(c) FH Aachen 2009

	//file: 		adis1635x.h
	//purpose:	define constants for analog devices adis1635x
	//			6DOF sensor via SPI

	#define ADIS_XROT   B16(00000011,00000000)
	#define ADIS_YROT   B16(00000101,00000000)
    #define ADIS_ZROT   B16(00001001,00000000)
	#define ADIS_XTRANS B16(00001011,00000000)
	#define ADIS_YTRANS B16(00001101,00000000)
    #define ADIS_ZTRANS B16(00001111,00000000)
	#define ADIS_XTEMP  B16(00000000,00010001)
	#define ADIS_YTEMP  B16(00000000,00010011)
    #define ADIS_ZTEMP  B16(00000000,00010101)
	#define XGYRO_OFF   B32(10011011,00000000,10011010,00000000)
    #define YGYRO_OFF   B32(10011101,00000000,10011100,00000000)
    #define ZGYRO_OFF   B32(10011111,00000000,10111100,00000000)
    #define XACCL_OFF   B32(10100001,00000000,10100000,00000000)
    #define YACCL_OFF   B32(10100011,00000000,10100010,00000000)
    #define ZACCL_OFF   B32(10100101,00000000,10100100,00000000)
	#define SMPL_PRD    B32(10110111,00000000,10110110,00000111) //Sampling period 819 SPS (sample per second)
	#define DYN_RANG    B32(10111001,00000100,10111000,00000110) //300Deg/sec Range and 64 taps

//Error definition for ADIS. (Please Refer page.20 on ADIS datasheet)
	#define ADIS_NO_ERROR				0
	#define ADIS_ERROR_POWER_BELOW		B8(00000001)
	#define ADIS_ERROR_POWER_ABOVE		B8(00000010)
	#define ADIS_ERROR_CONTROL_REG		B8(00000100)
	#define ADIS_ERROR_SPI				B8(00001000)
	#define ADIS_ERROR_SENSOR_OVERRANGE B8(00010000)
	#define ADIS_ERROR_SELFTEST			B8(00100000)
	#define ADIS_ERROR					0xff	//indicates one or more error type occurs

	#define ADIS_STALL   15
	#define ADIS_STALL1   _delay_us(15);
    #define ADIS_STALL2   _delay_us(15);
	#define ADIS_STALL3   _delay_us(15);
	#define ADIS_STALL4   _delay_us(15);
    #define ADIS_STALL5   _delay_us(15);
	#define ADIS_STALL6   _delay_us(15);
	#define ADIS_STALL_INIT 15


    void SpiWriteWordAdis(bytes16bits Instruction);
	bytes16bits SpiReadWordAdis(bytes16bits Instruction);
	uint8_t InitAdis(void);
	uint8_t AdisGetAcceleration(bytes16bits * pAdis16bit , bytes16bits * pAdisRegister);
	uint8_t AdisGetAccelerationSingle(bytes16bits * pAdis16bit , bytes16bits * pAdisRegister);
    uint8_t AdisGetData(struct_data_set *psDataSet);
    uint8_t SampleSensorData(struct_data_set *psDataSet);

	void   AdisGetTemp_X(struct_data_set *psDataSet);
    void   AdisGetTemp_Y(struct_data_set *psDataSet);
    void   AdisGetTemp_Z(struct_data_set *psDataSet);



